package com.shsubway.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shsubway.R;
import com.shsubway.model.TestEntity;

import java.util.List;

/**
 * Created by Hu on 2017/3/14.
 */

public class TestAdapter extends BaseQuickAdapter<TestEntity, BaseViewHolder> {
    public TestAdapter(int layoutResId, List<TestEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, TestEntity item) {
        helper
                .setText(R.id.test_no, "考试编号" + item.getObjectId() + "满分：" + (item.getDanScore() * item.getDanNo() + item.getDuoNo() * item.getDuoScore() + item.getPanNo() * item.getPanScore()))
                .setText(R.id.test_dan, "单选题" + item.getDanNo() + "个，每题：" + item.getDanScore() + "分，共" +
                        (item.getDanScore() * item.getDanNo())+"分")
                .setText(R.id.test_duo, "多选题" + item.getDuoNo() + "个，每题：" + item.getDuoScore() + "分，半对半错" + item.getScoreWrong() + "分，共" +
                        (item.getDuoScore() * item.getDuoNo())+"分")
                .setText(R.id.test_pan, "判断题" + item.getPanNo() + "个，每题：" + item.getPanScore() + "分，共" +
                        (item.getPanScore() * item.getPanNo())+"分")
                .setText(R.id.test_date, "日期：" + item.getCreatedAt());
    }
}
